package com.smart.manager.system.entities.body;

import com.smart.common.entities.core.BaseSearch;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * systemLog模型
 *
 * @author xiaxuqiu
 */
public class RLogOperation {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RLogOperation1")
    public static class SearchBody extends BaseSearch {


        @ApiModelProperty("操作员")
        private String operator;


        @ApiModelProperty("客户端IP")
        private String ip;

        @ApiModelProperty("所在包名")
        private String packageName;

        @ApiModelProperty("日期段")
        private String dateRange ;

    }


    @Data
    @ApiModel("RLogOperation2")
    public static class EditBody  implements Serializable {

        /**
         * 角色代码
         */

        @ApiModelProperty("操作员")
        @Length(max= 30,message="操作员 不能超过30个字符")
        @NotBlank(message = " 操作员  不能为空")
        private String operator;


        @ApiModelProperty("客户端IP")
        @Length(max= 30,message="客户端IP 不能超过20个字符")
        @NotBlank(message = " 客户端IP  不能为空")
        private String ip;

        @ApiModelProperty("所在包名")
        @Length(max= 30,message="所在包名 不能超过255个字符")
        @NotBlank(message = " 所在包名  不能为空")
        private String packageName;


        @ApiModelProperty("执行类名")
        private String className;

        @ApiModelProperty("日志标题")
        private String event;

        @ApiModelProperty("请求客户端操作系统")
        private String os;

        @ApiModelProperty("请求浏览器")
        private String browser;

        @ApiModelProperty("请求路径")
        private String requestUrl;

        @ApiModelProperty("请求参数")
        private String requestParam;

        @ApiModelProperty("请求类型")
        private String requestMethod;

        @ApiModelProperty("操作时间")
        private LocalDateTime actionTime;

    }


}
